﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>delete file and folder</title>
<meta name="GENERATOR" content="WinCHM">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

</head>

<body>
<P><A 
href="http://www.cyberciti.biz/faq/howto-linux-unix-delete-remove-file/"><FONT 
face=Courier>http://www.cyberciti.biz/faq/howto-linux-unix-delete-remove-file/</FONT></A></P>
<H2 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 1.83em 0px 0.61em; WORD-SPACING: 0px; FONT: bold 1.28em/22px Arial, 'Helvetica Neue', Helvetica, sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(17,17,17); TEXT-INDENT: 0px; PADDING-TOP: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">rm 
command syntax</H2>
<P 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px 0px 1.57em; WORD-SPACING: 0px; FONT: 14px/22px Arial, 'Helvetica Neue', Helvetica, sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(17,17,17); TEXT-INDENT: 0px; PADDING-TOP: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">rm 
(short for remove) is a Unix / Linux command which is used to delete files from 
a filesystem. Usually, on most filesystems, deleting a file requires write 
permission on the parent directory (and execute permission, in order to enter 
the directory in the first place). The syntax is as follows:</P>
<P 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px 0px 1.57em; WORD-SPACING: 0px; FONT: 14px/22px Arial, 'Helvetica Neue', Helvetica, sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(17,17,17); TEXT-INDENT: 0px; PADDING-TOP: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px"><CODE 
style="BORDER-RIGHT: rgb(221,221,221) 1px solid; PADDING-RIGHT: 0.91em; BACKGROUND-POSITION: 0px 0px; BORDER-TOP: rgb(221,221,221) 1px solid; DISPLAY: block; PADDING-LEFT: 0.91em; FONT-SIZE: 0.85em; BACKGROUND-ATTACHMENT: scroll; BACKGROUND-IMAGE: none; PADDING-BOTTOM: 0.66em; MARGIN: 0px 0px 1.83em; OVERFLOW: auto; BORDER-LEFT: rgb(221,221,221) 1px solid; LINE-HEIGHT: 1.5em; PADDING-TOP: 0.66em; BORDER-BOTTOM: rgb(221,221,221) 1px solid; FONT-FAMILY: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif; BACKGROUND-COLOR: rgb(238,238,238)">rm 
-f -r {<SPAN 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; COLOR: rgb(153,102,51); PADDING-TOP: 0px">file-name</SPAN>}</CODE></P>
<P 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px 0px 1.57em; WORD-SPACING: 0px; FONT: 14px/22px Arial, 'Helvetica Neue', Helvetica, sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(17,17,17); TEXT-INDENT: 0px; PADDING-TOP: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">Where,</P>
<UL 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px 0px 1.57em 1.57em; WORD-SPACING: 0px; FONT: 14px/22px Arial, 'Helvetica Neue', Helvetica, sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(17,17,17); TEXT-INDENT: 0px; PADDING-TOP: 0px; WHITE-SPACE: normal; LIST-STYLE-TYPE: square; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">
  <LI 
  style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">-f: 
  Forcefully remove file</LI>
  <LI 
  style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">-r: 
  Remove the contents of directories recursively</LI></UL>
<H2 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 1.83em 0px 0.61em; WORD-SPACING: 0px; FONT: bold 1.28em/22px Arial, 'Helvetica Neue', Helvetica, sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(17,17,17); TEXT-INDENT: 0px; PADDING-TOP: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">Remove 
or Delete a File</H2>
<P 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px 0px 1.57em; WORD-SPACING: 0px; FONT: 14px/22px Arial, 'Helvetica Neue', Helvetica, sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(17,17,17); TEXT-INDENT: 0px; PADDING-TOP: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">To 
remove a file called abc.txt type the following command:<BR 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"><CODE 
style="BORDER-RIGHT: rgb(221,221,221) 1px solid; PADDING-RIGHT: 0.91em; BACKGROUND-POSITION: 0px 0px; BORDER-TOP: rgb(221,221,221) 1px solid; DISPLAY: block; PADDING-LEFT: 0.91em; FONT-SIZE: 0.85em; BACKGROUND-ATTACHMENT: scroll; BACKGROUND-IMAGE: none; PADDING-BOTTOM: 0.66em; MARGIN: 0px 0px 1.83em; OVERFLOW: auto; BORDER-LEFT: rgb(221,221,221) 1px solid; LINE-HEIGHT: 1.5em; PADDING-TOP: 0.66em; BORDER-BOTTOM: rgb(221,221,221) 1px solid; FONT-FAMILY: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif; BACKGROUND-COLOR: rgb(238,238,238)">$ 
rm abc.txt</CODE></P>
<P 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px 0px 1.57em; WORD-SPACING: 0px; FONT: 14px/22px Arial, 'Helvetica Neue', Helvetica, sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(17,17,17); TEXT-INDENT: 0px; PADDING-TOP: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">To 
remove all files &amp; subdirectories from a directory (MS-DOS deltree like 
command), enter:<BR 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"><CODE 
style="BORDER-RIGHT: rgb(221,221,221) 1px solid; PADDING-RIGHT: 0.91em; BACKGROUND-POSITION: 0px 0px; BORDER-TOP: rgb(221,221,221) 1px solid; DISPLAY: block; PADDING-LEFT: 0.91em; FONT-SIZE: 0.85em; BACKGROUND-ATTACHMENT: scroll; BACKGROUND-IMAGE: none; PADDING-BOTTOM: 0.66em; MARGIN: 0px 0px 1.83em; OVERFLOW: auto; BORDER-LEFT: rgb(221,221,221) 1px solid; LINE-HEIGHT: 1.5em; PADDING-TOP: 0.66em; BORDER-BOTTOM: rgb(221,221,221) 1px solid; FONT-FAMILY: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif; BACKGROUND-COLOR: rgb(238,238,238)">$ 
rm -rf mydir</CODE></P>
<P 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px 0px 1.57em; WORD-SPACING: 0px; FONT: 14px/22px Arial, 'Helvetica Neue', Helvetica, sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(17,17,17); TEXT-INDENT: 0px; PADDING-TOP: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">To 
remove empty directory use rmdir and not rm command:<BR 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"><CODE 
style="BORDER-RIGHT: rgb(221,221,221) 1px solid; PADDING-RIGHT: 0.91em; BACKGROUND-POSITION: 0px 0px; BORDER-TOP: rgb(221,221,221) 1px solid; DISPLAY: block; PADDING-LEFT: 0.91em; FONT-SIZE: 0.85em; BACKGROUND-ATTACHMENT: scroll; BACKGROUND-IMAGE: none; PADDING-BOTTOM: 0.66em; MARGIN: 0px 0px 1.83em; OVERFLOW: auto; BORDER-LEFT: rgb(221,221,221) 1px solid; LINE-HEIGHT: 1.5em; PADDING-TOP: 0.66em; BORDER-BOTTOM: rgb(221,221,221) 1px solid; FONT-FAMILY: Consolas, 'Andale Mono', Monaco, Courier, 'Courier New', Verdana, sans-serif; BACKGROUND-COLOR: rgb(238,238,238)">$ 
rmdir mydirectory</CODE></P></body>
</html>
